<!DOCTYPE html>
<!--[if IE 8]> <html lang="zh-CN" class="ie8"> <![endif]-->
<html lang="zh-CN">

	<head>
		<meta charset="utf-8" />
		<title>结算页面</title>
		<meta http-equiv="content-type" content="text/html; charset=utf-8" />
		<meta content="telephone=no,email=no,address=no" name="format-detection" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
		<meta name="msapplication-tap-highlight" content="no">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		<meta name="wap-font-scale" content="no">
		<meta name="Keywords" content="" />
		<meta name="Description" content="" />

		<link rel="stylesheet" href="__TMPL__Public/css/common.css" />
		<link rel="stylesheet" href="__TMPL__Public/css/public.css" />
		<link rel="stylesheet" href="/themes/wnsc_moblie/newMobile/Pay/Css/flow.css" />
		<link rel="stylesheet" href="/themes/wnsc_moblie/newMobile/Pay/Css/honeyswitch.css" />
		<script type="text/javascript" src="/themes/wnsc_moblie/newMobile/User/js/area/jquery.min.js"></script>
		<script type="text/javascript" src="__TMPL__Public/js/common.js"></script>
		<script type="text/javascript" src="/themes/wnsc_moblie/newMobile/Pay/js/honeyswitch.js"></script>
			<script src="/themes/wnsc_moblie/newMobile/Shop/js/layer.js"></script>
	</head>

	<body>
		<div class="content-main">
			<?php
				$agent = $_SERVER['HTTP_USER_AGENT'];
				if(strpos($agent,"Html5Plus") === false){
			?>
			<header>
				<div class="tab_nav">
					<div class="header">
						<div class="header-left">
							<a class="sb-back" href="javascript:history.back(-1)" title="返回"></a>
						</div>
						<div class="header-middle">结算页面</div>
						<div class="h-right"></div>
					</div>
				</div>
			</header>
			<?php
				}
			?>
			<div class="payment">
				<div class="payment-con">
					<div class="payment-msg">
						<h3>最后一步，请尽快付款！</h3>
						<p>订单号：{$_GET['order_cn']}</p>
						<input type="hidden" id="order_id" value="4671" />
						<p>应付金额：￥{:number_format($count_price,2)}</p>
					</div>
				</div>

				<div class="pay-type-box">
					<div class="pay-type-content">
						<!--支付详情end-->
						<div class="surplus-pay" id="balance_money_pay">
							剩余应付金额
							<em class="SZY-ORDER-MONEY-PAY price-color">￥{:number_format($count_price,2)}</em> 请选择以下支付方式支付
						</div>
						<!--支付方式-->

						<!-- 银行支付方式调用 -->
						<div class="pay-all" id="pay_bank">
							<ul class="payment-tab" id="paylist">
								<php>
									$isweixin=is_weixin();
									if($wchat['wpay_is_use']){
								</php>
									
								<li class="weixin">
									<i class="iconfont"></i>
									<span>微信</span>
									<input type="radio"  name="pay_code" class="pay-code pay-way-checkbox selected" value="wchat"  checked="checked">
								</li>
								
								<php>}</php>
								<php>
									
									if($alipay['alipay_is_use']&&!$isweixin){
								</php>
									<li class="alipay">
										<i class="iconfont"></i>
										<span>支付宝</span>
										<input type="radio"  name="pay_code" class="pay-code pay-way-checkbox selected" value="alipay" >
									</li>
								
								<php>}</php>
							
								
								
							</ul>

						</div>
					</div>

					<div class="pay-again-bottom">
						<a href="javascript:void(0);" class="submit-btn gopay pay-again-btn" id="pay">立即付款</a>
					</div>
				</div>
			</div>

		</div>
		<script type="text/javascript">
			<php>
				$isweixin=is_weixin();
				if($isweixin){
			</php>
				var isweixin=1;
			<php>}else{</php>
				var isweixin=0;
			<php>}</php>
			//去支付
			$(function(){
				$('.pay-code').click(function() {
							$('.pay-code').removeClass('selected');
							$(this).addClass('selected');
				});
				$("#pay").click(function() {
					
					if($('#paylist .selected').length > 0) {
						console.log($('#paylist .selected').val())
						switch($('#paylist .selected').val()) {
							case "wchat":
								var url = "{:U('pay/wchatpay',array('order_cn'=>$_GET['order_cn']))}";
                                window.location.href=url
								break;
							case "alipay":
								//跳转到支付宝
								if(isweixin==0){
									var url = "{:U('pay/alipay',array('order_cn'=>$_GET['order_cn']))}";
									window.location.href=url
								}else{
									layer.msg('请用非微信打开本页面进行支付！');
								}
								break;
						}
						
						
					}else{
						layer.msg('请选择支付方式！');
					}
				})
			})
				
		</script>
	</body>

</html>